﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PromotionDetail.aspx.cs"
    Inherits="ThienLoc.Admin.PromotionDetail" MasterPageFile="~/Admin/AdminSite.Master" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
    <div class="NoiDungChinh">
        <img class="FormImage" src="images/computer.png" />
        <p class="FormTitle">
            Quản lý tin khuyến mãi</p>
    </div>
    <div class="NoiDung">
        <asp:MultiView ID="MultiView1" runat="server">
            <asp:View ID="ViewThemMoi" runat="server">
                <table width="100%">
                    <tr>
                        <td style="width: 250px;">
                            Tên chương trình khuyến mãi
                        </td>
                        <td>
                            <asp:TextBox ID="txtTen" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            Nội dung chương trình
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <FCKeditorV2:FCKeditor ID="txtContent" runat="server" Height="300" Width="100%" ToolbarStartExpanded="true">
                            </FCKeditorV2:FCKeditor>
                        </td>
                    </tr>
                </table>
                <br />
                <asp:Button ID="btnLuu" runat="server" Text="Cập nhật" CssClass="cmdBtn" OnClick="btnLuu_Click" />
                <asp:Button ID="btnHuy" runat="server" Text="Hủy" CssClass="cmdBtn" 
                    onclick="btnHuy_Click" />
            </asp:View>
            <asp:View ID="ViewDanhSach" runat="server">
                <asp:Button ID="btnThemMoi" runat="server" Text="Thêm mới chương trình khuyến mãi" CssClass="cmdBtn"
                    OnClick="btnThemMoi_Click" />
                <asp:GridView ID="grvData" runat="server" AutoGenerateColumns="False" CssClass="ListTable"
                    OnRowCommand="grvData_RowCommand" OnRowCancelingEdit="grvData_RowCancelingEdit"
                    OnRowEditing="grvData_RowEditing" OnRowDeleting="grvData_RowDeleting" DataKeyNames="ID">
                    <Columns>
                        <asp:TemplateField HeaderText="STT">
                            <ItemTemplate>
                                <%# Container.DataItemIndex + 1 %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tên chương trình khuyễn mãi">
                            <ItemTemplate>
                                <%# Eval("TenDM") %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Sửa">
                            <HeaderStyle Wrap="False"></HeaderStyle>
                            <ItemStyle Wrap="False" Width="60px"></ItemStyle>
                            <ItemTemplate>
                                <asp:ImageButton ID="imgEdit" runat="server" ImageUrl="../images/edit.gif" ToolTip="Sửa"
                                    CommandArgument='<%# Eval("ID")%>' CommandName="<%# ThienLoc.MyConst.Action.Approve %>">
                                </asp:ImageButton>
                                <asp:ImageButton ID="imgDelete" runat="server" ImageUrl="../images/del.png" ToolTip="Xóa"
                                    CommandArgument='<%# Eval("ID")%>' CommandName="<%# ThienLoc.MyConst.Action.Delete %>"
                                    OnClientClick="return confirm('Bạn có chắc là muốn kết thúc chương trình khuyến mãi này không ?')">
                                </asp:ImageButton>
                            </ItemTemplate>
                            <ItemStyle Width="70px"></ItemStyle>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </asp:View>
        </asp:MultiView>
    </div>
</asp:Content>
